package com.jinmdz.app.api.api.controller;

import com.jinmdz.app.api.api.service.TakeAshService;
import com.jinmdz.app.api.base.BaseController;
import com.jinmdz.app.dao.model.cremation.CremationItem;
import com.jinmdz.app.dao.model.cremation.CremationViewItem;
import com.jinmdz.app.dao.model.cremation.SearchTakeAshData;
import com.jinmdz.app.dao.model.cremation.SearchTakeAshViewItem;
import com.jinmdz.fmis.core.base.BaseResult;
import com.jinmdz.fmis.core.model.SearchLoadData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;

@Api(description = "取灰相关接口")
@RestController()
@RequestMapping("/api/take-ash")

public class TakeAshController extends BaseController {
    @Resource
    private TakeAshService takeAshService;
    /**
     *骨灰发放待取灰信息查询列表加载接口
     * @author shan
     * @date 2020/8/25 14:28
     * @param data
     * @return com.jinmdz.fmis.core.base.BaseResult<java.util.ArrayList<com.jinmdz.app.dao.model.cremation.SearchTakeAshViewItem>>
     */
    @ApiOperation(value = "取灰处", notes = "骨灰发放待取灰信息查询列表加载接口")
    @PostMapping("/load-take-ash-list")

    public BaseResult<ArrayList<SearchTakeAshViewItem>> loadTakeAshList(@RequestBody SearchTakeAshData data) {
        return resultHandler(data, userItem -> takeAshService.loadTakeAshList(data));
    }

}
